<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019\6\12 0012
 * Time: 21:51
 */

namespace BigVideo\IMooc\Database;

class PDO implements IDatabase
{
    /**
     * @var \PDO
     */
    protected $conn;
    public function connect($host, $user, $passwd, $dbname)
    {
        $this->conn = new \PDO("mysqli:host=$host;dbname=$dbname",$user,$passwd);
    }

    public function query($sql)
    {
        return $this->conn->query($sql);
    }

    public function close()
    {
        unset($this->conn);
    }
}














